﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using FlatRedBall;
using FlatRedBall.Math.Geometry;

namespace TopDownShooter
{
    class ProgressBar : PositionedObject
    {
        AxisAlignedRectangle m_Bar;
        public ProgressBar()
        {
            m_Bar = ShapeManager.AddAxisAlignedRectangle();
            m_Bar.AttachTo(this, false);
            m_Bar.ScaleX = 0;
            m_Bar.ScaleY = .5f;
        }
        public float Width = 8;
        public void setPercentage(float percentage)
        {
            m_Bar.ScaleX = Width * percentage;
            m_Bar.RelativeX = Width * percentage;
        }
        public void Destroy()
        {
            ShapeManager.Remove(m_Bar);
            this.RemoveSelfFromListsBelongingTo();
        }
    }
}
